import store from '@/store'
// 视图组件
export const view = {
  tabs: () => import('@/layouts/tabs'),
  blank: () => import('@/layouts/BlankView'),
  page: () => import('@/layouts/PageView'),
  iframePageView: () => import('@/layouts/IframePageView')
}

// 路由组件注册
const routerMap = {
  login: {
    path: '/login',
    name: 'login',
    meta: { title: '登录', i18n: { CN: '登录', US: 'login', HK: '登錄' }},
    // component: () => import('@/pages/login')
    component: () => {
      const login = store?.state?.setting?.login
      return import(`@/pages/login/${login || 'Login'}.vue`)
    }
  },
  loginsso1: {
    authority: '*',
    path: '/loginsso1',
    name: 'loginsso1',
    component: () => import('@/pages/login/LoginSSO1')
  },
  loginsso2: {
    authority: '*',
    path: '/loginsso2',
    name: 'loginsso2',
    component: () => import('@/pages/login/LoginSSO2')
  },
  root: {
    path: '/',
    name: '首页',
    redirect: '/dashboard/analysis',
    component: view.tabs
  },
  dashboard: {
    name: 'Dashboard',
    meta: { title: '首页', icon: 'dashboard' },
    component: view.blank
  },
  analysis: {
    name: '首页',
    path: '/dashboard/analysis',
    meta: { title: '首页', icon: 'dashboard', i18n: { CN: '首页', US: 'home', HK: '首頁' }},
    component: () => import('@/pages/dashboard/analysis')
  },
  account: {
    name: '个人中心',
    path: '/account/center',
    meta: { title: '个人中心', hidden: true, i18n: { CN: '个人中心', US: 'center', HK: '個人中心' }},
    component: () => import('@/pages/account/center/Index')
  },
  exception: {
    name: '异常页',
    icon: 'warning',
    component: view.blank
  },
  exp403: {
    name: 'exp403',
    path: '403',
    component: () => import('@/pages/exception/403')
  },
  exp404: {
    name: 'exp404',
    path: '404',
    component: () => import('@/pages/exception/404')
  },
  exp500: {
    name: 'exp500',
    path: '500',
    component: () => import('@/pages/exception/500')
  }
  // isystem: {
  //   name: '系统设置',
  //   path: 'isystem',
  //   meta: { title: '系统设置', hidden: true, icon: 'setting' },
  //   component: view.blank
  // },
  // menuList: {
  //   name: '菜单管理',
  //   path: 'menuList',
  //   meta: { title: '菜单管理', hidden: true },
  //   component: () => import('@/pages/system/MenuList')
  // }
}
export default routerMap

